package com.fyt.reachgo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.amqp.support.converter.SimpleMessageConverter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import java.util.Collections;

@SpringBootApplication
@EnableJpaRepositories(basePackages = "com.fyt.reachgo.Repository")
@EntityScan(basePackages = "com.fyt.reachgo.domain")
@MapperScan("com.fyt.reachgo.mapper")
public class ReachGoApplication {

    public static void main(String[] args) {
        SpringApplication.run(ReachGoApplication.class, args);
    }


    @Bean
    public MessageConverter messageConverter() {    
        SimpleMessageConverter converter = new SimpleMessageConverter();
        converter.setAllowedListPatterns(Collections.singletonList("com.fyt.reachgo.domain.*"));
        return converter;
    }

}
